package com.jeesite.modules.digitalize.constants;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum AuditEnum {

    NO_AUDIT(0, "待审核"),
    AUDITING(1, "审核中"),
    PASS(3, "通过"),
    REFUSE(4, "拒绝" );
    /*
        用户端：已预约-服务中-待取件-已完成
        商户端: 已预约-待清洗-清洗中-待取件-已完成-已取消
     */
    public  static final String info = "0待审核 1审核中 3通过 4 拒绝";
    private final Integer code;
    private final String desc;

    AuditEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static AuditEnum getByCode(Integer code) {
        if (code != null) {
            return Arrays.stream(AuditEnum.values()).filter(item -> item.code.equals(code)).findFirst().get();
        }
        return null;
    }
}